package com.neofinance.reactdemo;

public class ApiResponse<T> {
    private String path;
    private CODE responseCode;
    private String action;
    private T result;

    public enum CODE {
        SUCCESS, FAIL, WARN
    }

    public ApiResponse(String path, CODE responseCode, String action, T result) {
        this.path = path;
        this.responseCode = responseCode;
        this.action = action;
        this.result = result;
    }

    public String getPath() {
        return path;
    }

    public CODE getResponseCode() {
        return responseCode;
    }

    public String getAction() {
        return action;
    }

    public T getResult() {
        return result;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public void setResponseCode(CODE responseCode) {
        this.responseCode = responseCode;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public void setResult(T result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "ApiResponse{" +
                "path='" + path + '\'' +
                ", responseCode=" + responseCode +
                ", action='" + action + '\'' +
                ", result=" + result +
                '}';
    }
}
